package com.zjy.satoken;

import cn.dev33.satoken.stp.StpInterface;
import com.zjy.business.system.common.SysPermissionCommon;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * @author yxb
 * create_time: 2024-10-22 14:12
 * description: 
 */
@RequiredArgsConstructor
@Slf4j
public class PermissionStpInterface implements StpInterface {


    final private SysPermissionCommon sysPermissionCommon;

    @Override
    public List<String> getPermissionList(Object loginId, String loginKey) {
        return sysPermissionCommon.getUserPermission(Long.valueOf(loginId.toString()));
    }

    @Override
    public List<String> getRoleList(Object userId, String loginKey) {
        return sysPermissionCommon.getUserRoleList(Long.valueOf(userId.toString()));
    }
}
